﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using chemicall.data;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate;

namespace chemicall.consoleSerializer
{
    class Program
    {
        static void Main(string[] args)
        {
            // TODO: Add your initialization logic here
            LevelDescription levelDescription = new LevelDescription()
            {
                num = 1,
                name = "Start Level",
                listEntities = new List<EntityDescription>() {
                    new EntityDescription {
                        typeID = 1,
                        initPosXY = new Point(100, 0),
                        dimXY = new Point(50,36)
                    },
                    new EntityDescription {
                        typeID = 2,
                        initPosXY = new Point(50, 20),
                        dimXY = new Point(50,36)
                    },
                    new EntityDescription {
                        typeID = 3,
                        initPosXY = new Point(150, 20),
                        dimXY = new Point(50, 36)
                    },
                    new EntityDescription {
                        typeID = 100,
                        initPosXY = new Point(0, 400),
                        dimXY = new Point(250, 200),
                        name="ground"
                    },
                    new EntityDescription {
                        typeID = 100,
                        initPosXY = new Point(300, 300),
                        dimXY = new Point(300, 100),
                        name="ground"
                    },
                    new EntityDescription {
                        typeID = 0,
                        initPosXY = new Point(0, 0),
                        dimXY = new Point(1024, 1024),
                        name = "sky"
                    }
                }
            };

            XmlWriterSettings settings = new XmlWriterSettings();
            settings.Indent = true;

            using (XmlWriter writer = XmlWriter.Create("levelTwo.xml", settings))
            {
                IntermediateSerializer.Serialize<LevelDescription>(writer, levelDescription, null);
            }
        }
    }
}
